home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / elispman.lha / elispman / elisp-29 (.txt) < prev    next >
GNU Info File  |  1993-06-01  |  51KB  |  904 lines

  1. This is Info file elisp, produced by Makeinfo-1.55 from the input file
  2. elisp.texi.
  3.    This is edition 2.0 of the GNU Emacs Lisp Reference Manual, for
  4. Emacs Version 19.
  5.    Published by the Free Software Foundation, 675 Massachusetts Avenue,
  6. Cambridge, MA 02139 USA
  7.    Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided that
  13. the entire resulting derived work is distributed under the terms of a
  14. permission notice identical to this one.
  15.    Permission is granted to copy and distribute translations of this
  16. manual into another language, under the above conditions for modified
  17. versions, except that this permission notice may be stated in a
  18. translation approved by the Foundation.
  19. File: elisp,  Node: Holiday Customizing,  Next: Date Display Format,  Prev: Calendar Customizing,  Up: Calendar
  20. Customizing the Holidays
  21. ========================
  22.    Emacs knows about holidays defined by entries on one of several
  23. lists.  You can customize theses lists of holidays to your own needs,
  24. adding holidays or deleting lists of holidays.  The lists of holidays
  25. that Emacs uses are for general holidays (`general-holidays'), local
  26. holidays (`local-holidays'), Christian holidays (`christian-holidays'),
  27. Hebrew (Jewish) holidays (`hebrew-holidays'), Islamic (Moslem) holidays
  28. (`islamic-holidays'), and other holidays (`other-holidays').
  29.    The general holidays are, by default, holidays common throughout the
  30. United States.  To eliminate these holidays, set `general-holidays' to
  31. `nil'.
  32.    There are no default local holidays (but sites may supply some).  You
  33. can set the variable `local-holidays' to any list of holidays, as
  34. described below.
  35.    By default, Emacs does not consider all the holidays of these
  36. religions, only those commonly found in secular calendars.  For a more
  37. extensive collection of religious holidays, you can set any (or all) of
  38. the variables `all-christian-calendar-holidays',
  39. `all-hebrew-calendar-holidays', or `all-islamic-calendar-holidays' to
  40. `t'.  If you want to eliminate the religious holidays, set any or all
  41. of the corresponding variables `christian-holidays', `hebrew-holidays',
  42. and `islamic-holidays' to `nil'.
  43.    You can set the variable `other-holidays' to any list of holidays.
  44. This list, normally empty, is intended for your use.
  45.    Each of the lists (`general-holidays'), (`local-holidays'),
  46. (`christian-holidays'), (`hebrew-holidays'), (`islamic-holidays'),and
  47. (`other-holidays') is a list of "holiday forms", each holiday form
  48. describing a holiday (or sometimes a list of holidays).  Holiday forms
  49. may have the following formats:
  50. `(fixed MONTH DAY STRING)'
  51.      A fixed date on the Gregorian calendar.  MONTH and DAY are
  52.      numbers, STRING is the name of the holiday.
  53. `(float MONTH DAYNAME K STRING)'
  54.      The Kth DAYNAME in MONTH on the Gregorian calendar (DAYNAME=0 for
  55.      Sunday, and so on); negative K means count back from the end of
  56.      the month.  STRING is the name of the holiday.
  57. `(hebrew MONTH DAY STRING)'
  58.      A fixed date on the Hebrew calendar.  MONTH and DAY are numbers,
  59.      STRING is the name of the holiday.
  60. `(islamic MONTH DAY STRING)'
  61.      A fixed date on the Islamic calendar.  MONTH and DAY are numbers,
  62.      STRING is the name of the holiday.
  63. `(julian MONTH DAY STRING)'
  64.      A fixed date on the Julian calendar.  MONTH and DAY are numbers,
  65.      STRING is the name of the holiday.
  66. `(sexp SEXP STRING)'
  67.      SEXP is a Lisp expression that should use the variable `year' to
  68.      compute the date of a holiday, or `nil' if the holiday doesn't
  69.      happen this year.  The value represents the date as a list of the
  70.      form `(MONTH DAY YEAR)'.  STRING is the name of the holiday.
  71. `(if BOOLEAN HOLIDAY-FORM &optional HOLIDAY-FORM)'
  72.      A choice between two holidays based on the value of BOOLEAN.
  73. `(FUNCTION &optional ARGS)'
  74.      Dates requiring special computation; ARGS, if any, are passed in a
  75.      list to the function `calendar-holiday-function-FUNCTION'.
  76.    For example, suppose you want to add Bastille Day, celebrated in
  77. France on July 14.  You can do this by adding the following line to
  78. your `.emacs' file:
  79.      (setq other-holidays '((fixed 7 14 "Bastille Day")))
  80. The holiday form `(fixed 7 14 "Bastille Day")' specifies the fourteenth
  81. day of the seventh month (July).
  82.    Many holidays occur on a specific day of the week, at a specific time
  83. of month.  Here is a holiday form describing Hurricane Supplication Day,
  84. celebrated in the Virgin Islands on the fourth Monday in August:
  85.      (float 8 1 4 "Hurricane Supplication Day")
  86. Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
  87. Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
  88. the month (1 specifies the first occurrence, 2 the second occurrence,
  89. -1 the last occurrence, -2 the second-to-last occurrence, and so on).
  90.    You can specify holidays that occur on fixed days of the Hebrew,
  91. Islamic, and Julian calendars too.  For example,
  92.      (setq other-holidays
  93.            '((hebrew 10 2 "Last day of Hanukkah")
  94.              (islamic 3 12 "Mohammed's Birthday")
  95.              (julian 4 2 "Jefferson's Birthday")))
  96. adds the last day of Hanukkah (since the Hebrew months are numbered with
  97. 1 starting from Nisan), the Islamic feast celebrating Mohammed's
  98. birthday (since the Islamic months are numbered from 1 starting with
  99. Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
  100. Julian calendar.
  101.    To include a holiday conditionally, use either the `if' or the
  102. `sexp' form.  For example, American presidential elections occur on the
  103. first Tuesday after the first Monday in November of years divisible by
  104.      (sexp (if (= 0 (% year 4))
  105.                (calendar-gregorian-from-absolute
  106.                  (1+ (calendar-dayname-on-or-before
  107.                         1 (+ 6 (calendar-absolute-from-gregorian
  108.                                  (list 11 1 year))))))
  109.            "US Presidential Election"))
  110.      (if (= 0 (% displayed-year 4))
  111.          (fixed 11
  112.                 (extract-calendar-day
  113.                   (calendar-gregorian-from-absolute
  114.                     (1+ (calendar-dayname-on-or-before
  115.                           1 (+ 6 (calendar-absolute-from-gregorian
  116.                                    (list 11 1 displayed-year)))))))
  117.                 "US Presidential Election"))
  118.    Some holidays just don't fit into any of these forms because special
  119. calculations are involved in their determination.  In such cases you
  120. must write a Lisp function to do the calculation.  The function should
  121. return a (possibly empty) list of the relevant Gregorian dates among the
  122. range visible in the calendar window, with descriptive strings, like
  123. this:
  124.      (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
  125. File: elisp,  Node: Date Display Format,  Next: Time Display Format,  Prev: Holiday Customizing,  Up: Calendar
  126. Date Display Format
  127. ===================
  128.    You can customize the manner of displaying dates in the diary, in
  129. mode lines, and in messages by setting `calendar-date-display-form'.
  130. This variable is a list of expressions that can involve the variables
  131. `month', `day', and `year', all numbers in string form, and `monthname'
  132. and `dayname', both alphabetic strings.  In the American style, the
  133. default value of this list is as follows:
  134.      ((if dayname (concat dayname ", ")) monthname " " day ", " year)
  135. while in the European style this value is the default:
  136.      ((if dayname (concat dayname ", ")) day " " monthname " " year)
  137.    The ISO standard date representation is this:
  138.      (year "-" month "-" day)
  139. This specifies a typical American format:
  140.      (month "/" day "/" (substring year -2))
  141. File: elisp,  Node: Time Display Format,  Next: Daylight Savings,  Prev: Date Display Format,  Up: Calendar
  142. Time Display Format
  143. ===================
  144.    In the calendar, diary, and related buffers, Emacs displays times of
  145. day in the conventional American style with the hours from 1 through 12,
  146. minutes, and either `am' or `pm'.  If you prefer the "military"
  147. (European) style of writing times--in which the hours go from 00 to
  148. 23--you can alter the variable `calendar-time-display-form'.  This
  149. variable is a list of expressions that can involve the variables
  150. `12-hours', `24-hours', and `minutes', all numbers in string form, and
  151. `am-pm' and `time-zone', both alphabetic strings.  The default
  152. definition of `calendar-time-display-form' is as follows:
  153.      (12-hours ":" minutes am-pm (if time-zone " (") time-zone (if time-zone ")"))
  154.    Setting `calendar-time-display-form' to
  155.      (24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")"))
  156. gives military-style times like `21:07 (UT)' if time zone names are
  157. defined, and times like `21:07' if they are not.
  158. File: elisp,  Node: Daylight Savings,  Next: Diary Customizing,  Prev: Time Display Format,  Up: Calendar
  159. Daylight Savings Time
  160. =====================
  161.    Emacs understands the difference between standard time and daylight
  162. savings time--the times given for sunrise, sunset, solstices,
  163. equinoxes, and the phases of the moon take that into account.  The
  164. default starting and stopping dates for daylight savings time are the
  165. present-day American rules of the first Sunday in April until the last
  166. Sunday in October, but you can specify whatever rules you want by
  167. setting `calendar-daylight-savings-starts' and
  168. `calendar-daylight-savings-ends'.  Their values should be Lisp
  169. expressions that refer to the variable `year', and evaluate to the
  170. Gregorian date on which daylight savings time starts or (respectively)
  171. ends, in the form of a list `(MONTH DAY YEAR)'.
  172.    Emacs uses these expressions to determine the starting date of
  173. daylight savings time for the holiday list and for correcting times of
  174. day in the solar and lunar calculations.
  175.    The default value of `calendar-daylight-savings-starts' is this,
  176.      (calendar-nth-named-day 1 0 4 year)
  177. which computes the first 0th day (Sunday) of the fourth month (April) in
  178. the year specified by `year'.  If daylight savings time were changed to
  179. start on October 1, you would set `calendar-daylight-savings-starts' to
  180.      (list 10 1 year)
  181.    For a more complex example, suppose daylight savings time begins on
  182. the first of Nisan on the Hebrew calendar.  You would set
  183. `calendar-daylight-savings-starts' to
  184.      (calendar-gregorian-from-absolute
  185.        (calendar-absolute-from-hebrew
  186.          (list 1 1 (+ year 3760))))
  187. because Nisan is the first month in the Hebrew calendar and the Hebrew
  188. year differs from the Gregorian year by 3760 at Nisan.
  189.    If there is no daylight savings time at your location, or if you want
  190. all times in standard time, set `calendar-daylight-savings-starts' and
  191. `calendar-daylight-savings-ends' to `nil'.
  192. File: elisp,  Node: Diary Customizing,  Next: Hebrew/Islamic Entries,  Prev: Daylight Savings,  Up: Calendar
  193. Customizing the Diary
  194. =====================
  195.    Ordinarily, the mode line of the diary buffer window indicates any
  196. holidays that fall on the date of the diary entries.  The process of
  197. checking for holidays can take several seconds, so including holiday
  198. information delays the display of the diary buffer noticeably.  If you'd
  199. prefer to have a faster display of the diary buffer but without the
  200. holiday information, set the variable `holidays-in-diary-buffer' to
  201. `nil'.
  202.    The variable `number-of-diary-entries' controls the number of days
  203. of diary entries to be displayed at one time.  It affects the initial
  204. display when `view-diary-entries-initially' is `t', as well as the
  205. command `M-x diary'.  For example, the default value is 1, which says
  206. to display only the current day's diary entries.  If the value is 2,
  207. both the current day's and the next day's entries are displayed.  The
  208. value can also be a vector of seven elements: if the value is `[0 2 2 2
  209. 2 4 1]' then no diary entries appear on Sunday, the current date's and
  210. the next day's diary entries appear Monday through Thursday, Friday
  211. through Monday's entries appear on Friday, while on Saturday only that
  212. day's entries appear.
  213.    The variable `print-diary-entries-hook' is a normal hook run after
  214. preparation of a temporary buffer containing just the diary entries
  215. currently visible in the diary buffer.  (The other, irrelevant diary
  216. entries are really absent from the temporary buffer; in the diary
  217. buffer, they are merely hidden.)  The default value of this hook does
  218. the printing with the command `lpr-buffer'.  If you want to use a
  219. different command to do the printing, just change the value of this
  220. hook.  Other uses might include, for example, rearranging the lines into
  221. order by day and time.
  222.    You can customize the form of dates in your diary file, if neither
  223. the standard American nor European styles suits your needs, by setting
  224. the variable `diary-date-forms'.  This variable is a list of forms of
  225. dates recognized in the diary file.  Each form is a list of regular
  226. expressions (*note Regular Expressions::.) and the variables `month',
  227. `day', `year', `monthname', and `dayname'.  The variable `monthname'
  228. matches the name of the month, capitalized or not, or its three-letter
  229. abbreviation, followed by a period or not; it matches `*'.  Similarly,
  230. `dayname' matches the name of the day, capitalized or not, or its
  231. three-letter abbreviation, followed by a period or not.  The variables
  232. `month', `day', and `year' match those numerical values, preceded by
  233. arbitrarily many zeros; they also match `*'.  The default value of
  234. `diary-date-forms' in the American style is
  235.      ((month "/" day "[^/0-9]")
  236.       (month "/" day "/" year "[^0-9]")
  237.       (monthname " *" day "[^,0-9]")
  238.       (monthname " *" day ", *" year "[^0-9]")
  239.       (dayname "\\W"))
  240. Emacs matches of the diary entries with the date forms is done with the
  241. standard syntax table from Fundamental mode (*note Syntax Tables::.),
  242. but with the `*' changed so that it is a word constituent.
  243.    The forms on the list must be *mutually exclusive* and must not
  244. match any portion of the diary entry itself, just the date.  If, to be
  245. mutually exclusive, the pattern must match a portion of the diary entry
  246. itself, the first element of the form *must* be `backup'.  This causes
  247. the date recognizer to back up to the beginning of the current word of
  248. the diary entry.  Even if you use `backup', the form must absolutely
  249. not match more than a portion of the first word of the diary entry.
  250. The default value of `diary-date-forms' in the European style is this
  251. list:
  252.      ((day "/" month "[^/0-9]")
  253.       (day "/" month "/" year "[^0-9]")
  254.       (backup day " *" monthname "\\W+\\<[^*0-9]")
  255.       (day " *" monthname " *" year "[^0-9]")
  256.       (dayname "\\W"))
  257. Notice the use of `backup' in the middle form because part of the diary
  258. entry must be matched to distinguish this form from the following one.
  259. File: elisp,  Node: Hebrew/Islamic Entries,  Next: Fancy Diary Display,  Prev: Diary Customizing,  Up: Calendar
  260. Hebrew- and Islamic-Date Diary Entries
  261. ======================================
  262.    Your diary file can have entries based on Hebrew or Islamic dates, as
  263. well as entries based on our usual Gregorian calendar.  However, because
  264. the processing of such entries is time-consuming and most people don't
  265. need them, you must customize the processing of your diary file to
  266. specify that you want such entries recognized.  If you want Hebrew-date
  267. diary entries, for example, you must include these lines in your
  268. `.emacs' file:
  269.      (setq nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
  270.      (setq nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
  271. If you want Islamic-date entries, include these lines in your `.emacs'
  272. file:
  273.      (setq nongregorian-diary-listing-hook 'list-islamic-diary-entries)
  274.      (setq nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
  275. If you want both Hebrew- and Islamic-date entries, include these lines:
  276.      (setq nongregorian-diary-listing-hook
  277.            '(list-hebrew-diary-entries list-islamic-diary-entries))
  278.      (setq nongregorian-diary-marking-hook
  279.            '(mark-hebrew-diary-entries mark-islamic-diary-entries))
  280.    Hebrew- and Islamic-date diary entries have the same formats as
  281. Gregorian-date diary entries, except that the date must be preceded with
  282. an `H' for Hebrew dates and an `I' for Islamic dates.  Moreover,
  283. because the Hebrew and Islamic month names are not uniquely specified
  284. by the first three letters, you may not abbreviate them.  For example,
  285. a diary entry for the Hebrew date Heshvan 25 could look like
  286.      HHeshvan 25 Happy Hebrew birthday!
  287. and would appear in the diary for any date that corresponds to Heshvan
  288. 25 on the Hebrew calendar.  Similarly, an Islamic-date diary entry
  289. might be
  290.      IDhu al-Qada 25 Happy Islamic birthday!
  291. and would appear in the diary for any date that corresponds to Dhu
  292. al-Qada 25 on the Islamic calendar.
  293.    As with Gregorian-date diary entries, Hebrew- and Islamic-date
  294. entries are nonmarking if they are preceded with an ampersand (`&').
  295.    There are commands to help you in making Hebrew- and Islamic-date
  296. entries to your diary:
  297. `i h d'
  298.      Add a diary entry for the Hebrew date corresponding to the
  299.      selected date (`insert-hebrew-diary-entry').
  300. `i h m'
  301.      Add a diary entry for the day of the Hebrew month corresponding to
  302.      the selected date (`insert-monthly-hebrew-diary-entry').
  303. `i h y'
  304.      Add a diary entry for the day of the Hebrew year corresponding to
  305.      the selected date (`insert-yearly-hebrew-diary-entry').
  306. `i i d'
  307.      Add a diary entry for the Islamic date corresponding to the
  308.      selected date (`insert-islamic-diary-entry').
  309. `i i m'
  310.      Add a diary entry for the day of the Islamic month corresponding
  311.      to the selected date (`insert-monthly-islamic-diary-entry').
  312. `i i y'
  313.      Add a diary entry for the day of the Islamic year corresponding to
  314.      the selected date (`insert-yearly-islamic-diary-entry').
  315.    These commands work exactly like the corresponding commands for
  316. ordinary diary entries: Move point to a date in the calendar window and
  317. the above commands insert the Hebrew or Islamic date (corresponding to
  318. the date indicated by point) at the end of your diary file and you can
  319. then type the diary entry.  If you want the diary entry to be
  320. nonmarking, give a numeric argument to the command.
  321. File: elisp,  Node: Fancy Diary Display,  Next: Included Diary Files,  Prev: Hebrew/Islamic Entries,  Up: Calendar
  322. Fancy Diary Display
  323. ===================
  324.    Diary display works by preparing the diary buffer and then running
  325. the hook `diary-display-hook'.  The default value of this hook hides
  326. the irrelevant diary entries and then displays the buffer
  327. (`simple-diary-display').  However, if you specify the hook as follows,
  328.      (add-hook 'diary-display-hook 'fancy-diary-display)
  329. then fancy mode displays diary entries and holidays by copying them into
  330. a special buffer that exists only for display.  Copying provides an
  331. opportunity to change the displayed text to make it prettier--for
  332. example, to sort the entries by the dates they apply to.
  333.    As with simple diary display, you can print a hard copy of the buffer
  334. with `print-diary-entries'.  To print a hard copy of a day-by-day diary
  335. for a week by positioning point on Sunday of that week, type `7 d' and
  336. then do `M-x print-diary-entries'.  As usual, the inclusion of the
  337. holidays slows down the display slightly; you can speed things up by
  338. setting the variable `holidays-in-diary-buffer' to `nil'.
  339.    Ordinarily, the fancy diary buffer does not show days for which
  340. there are no diary entries, even if that day is a holiday.  If you want
  341. such days to be shown in the fancy diary buffer, set the variable
  342. `diary-list-include-blanks' to `t'.
  343.    If you use the fancy diary display, you can use the normal hook
  344. `list-diary-entries-hook' to sort each day's diary entries by their
  345. time of day.  Add this line to your `.emacs' file:
  346.      (add-hook 'list-diary-entries-hook 'sort-diary-entries)
  347. For each day, this sorts diary entries that begin with a recognizable
  348. time of day according to their times.  Diary entries without times come
  349. first within each day.
  350. File: elisp,  Node: Included Diary Files,  Next: Sexp Diary Entries,  Prev: Fancy Diary Display,  Up: Calendar
  351. Included Diary Files
  352. ====================
  353.    If you use the fancy diary display, you can have diary entries from
  354. other files included with your own by an "include" mechanism.  This
  355. facility makes possible the sharing of common diary files among groups
  356. of users.  Lines in the diary file of this form:
  357.      #include "FILENAME"
  358. includes the diary entries from the file FILENAME in the fancy diary
  359. buffer (because the ordinary diary buffer is just the buffer associated
  360. with your diary file, you cannot use the include mechanism unless you
  361. use the fancy diary buffer).  The include mechanism is recursive, by
  362. the way, so that included files can include other files, and so on; you
  363. must be careful not to have a cycle of inclusions, of course.  To
  364. enable the include facility, add lines as follows to your `.emacs' file:
  365.      (add-hook 'list-diary-entries-hook 'include-other-diary-files)
  366.      (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
  367. File: elisp,  Node: Sexp Diary Entries,  Next: Appt Customizing,  Prev: Included Diary Files,  Up: Calendar
  368. Sexp Entries and the Fancy Diary Display
  369. ========================================
  370.    Sexp diary entries allow you to do more than just have complicated
  371. conditions under which a diary entry applies.  If you use the fancy
  372. diary display, sexp entries can generate the text of the entry depending
  373. on the date itself.  For example, an anniversary diary entry can insert
  374. the number of years since the anniversary date into the text of the
  375. diary entry.  Thus the `%d' in this dairy entry:
  376.      %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
  377. gets replaced by the age, so on October 31, 1990 the entry appears in
  378. the fancy diary buffer like this:
  379.      Arthur's birthday (42 years old)
  380. If the diary file instead contains this entry:
  381.      %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
  382. the entry in the fancy diary buffer for October 31, 1990 appears like
  383. this:
  384.      Arthur's 42nd birthday
  385.    Similarly, cyclic diary entries can interpolate the number of
  386. repetitions that have occurred:
  387.      %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
  388. looks like this:
  389.      Renew medication (5th time)
  390. in the fancy diary display on September 8, 1990.
  391.    The generality of sexp diary entries lets you specify any diary entry
  392. that you can describe algorithmically.  Suppose you get paid on the 21st
  393. of the month if it is a weekday, and to the Friday before if the 21st is
  394. on a weekend.  The diary entry
  395.      &%%(let ((dayname (calendar-day-of-week date))
  396.               (day (car (cdr date))))
  397.            (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
  398.                (and (memq day '(19 20)) (= dayname 5)))
  399.               ) Pay check deposited
  400. applies to just those dates.  This example illustrates how the sexp can
  401. depend on the variable `date'; this variable is a list (MONTH DAY YEAR)
  402. that gives the Gregorian date for which the diary entries are being
  403. found.  If the value of the expression is `t', the entry applies to
  404. that date.  If the expression evaluates to `nil', the entry does *not*
  405. apply to that date.
  406.    The following sexp diary entries take advantage of the ability (in
  407. the fancy diary display) to concoct diary entries based on the date:
  408. `%%(diary-sunrise-sunset)'
  409.      Make a diary entry for the local times of today's sunrise and
  410.      sunset.
  411. `%%(diary-phases-of-moon)'
  412.      Make a diary entry for the phases (quarters) of the moon.
  413. `%%(diary-day-of-year)'
  414.      Make a diary entry with today's day number in the current year and
  415.      the number of days remaining in the current year.
  416. `%%(diary-iso-date)'
  417.      Make a diary entry with today's equivalent ISO commercial date.
  418. `%%(diary-julian-date)'
  419.      Make a diary entry with today's equivalent date on the Julian
  420.      calendar.
  421. `%%(diary-astro-day-number)'
  422.      Make a diary entry with today's equivalent astronomical (Julian)
  423.      day number.
  424. `%%(diary-hebrew-date)'
  425.      Make a diary entry with today's equivalent date on the Hebrew
  426.      calendar.
  427. `%%(diary-islamic-date)'
  428.      Make a diary entry with today's equivalent date on the Islamic
  429.      calendar.
  430. `%%(diary-french-date)'
  431.      Make a diary entry with today's equivalent date on the French
  432.      Revolutionary calendar.
  433. `%%(diary-mayan-date)'
  434.      Make a diary entry with today's equivalent date on the Mayan
  435.      calendar.
  436. Thus including the diary entry
  437.      &%%(diary-hebrew-date)
  438. causes every day's diary display to contain the equivalent date on the
  439. Hebrew calendar, if you are using the fancy diary display.  (With simple
  440. diary display, the line `&%%(diary-hebrew-date)' appears in the diary
  441. for any date, but does nothing particularly useful.)
  442.    There are a number of other available sexp diary entries that are
  443. important to those who follow the Hebrew calendar:
  444. `%%(diary-rosh-hodesh)'
  445.      Make a diary entry that tells the occurrence and ritual
  446.      announcement of each new Hebrew month.
  447. `%%(diary-parasha)'
  448.      Make a Saturday diary entry that tells the weekly synagogue
  449.      scripture reading.
  450. `%%(diary-sabbath-candles)'
  451.      Make a Friday diary entry that tells the *local time* of Sabbath
  452.      candle lighting.
  453. `%%(diary-omer)'
  454.      Make a diary entry that gives the omer count, when appropriate.
  455. `%%(diary-yahrzeit MONTH DAY YEAR) NAME'
  456.      Make a diary entry marking the anniversary of a date of death.
  457.      The date is the *Gregorian* (civil) date of death.  The diary
  458.      entry appears on the proper Hebrew calendar anniversary and on the
  459.      day before.  (In the European style, the order of the parameters
  460.      is changed to DAY, MONTH, YEAR.)
  461. File: elisp,  Node: Appt Customizing,  Prev: Sexp Diary Entries,  Up: Calendar
  462. Customizing Appointment Reminders
  463. =================================
  464.    You can specify exactly how Emacs reminds you of an appointment and
  465. how far in advance it begins doing so.  Here are the variables that you
  466. can set:
  467. `appt-message-warning-time'
  468.      The time in minutes before an appointment that the reminder
  469.      begins.  The default is 10 minutes.
  470. `appt-audible'
  471.      If this is `t' (the default), Emacs rings the terminal bell for
  472.      appointment reminders.
  473. `appt-visible'
  474.      If this is `t' (the default), Emacs displays the appointment
  475.      message in echo area.
  476. `appt-display-mode-line'
  477.      If this is `t' (the default), Emacs displays the number of minutes
  478.      to the appointment on the mode line.
  479. `appt-msg-window'
  480.      If this is `t' (the default), Emacs displays the appointment
  481.      message in another window.
  482. `appt-display-duration'
  483.      The number of seconds an appointment message is displayed.  The
  484.      default is 5 seconds.
  485. File: elisp,  Node: Tips,  Next: GNU Emacs Internals,  Prev: Calendar,  Up: Top
  486. Tips and Standards
  487. ******************
  488.    This chapter describes no additional features of Emacs Lisp.
  489. Instead it gives advice on making effective use of the features
  490. described in the previous chapters.
  491. * Menu:
  492. * Style Tips::                Writing clean and robust programs.
  493. * Compilation Tips::          Making compiled code run fast.
  494. * Documentation Tips::        Writing readable documentation strings.
  495. * Comment Tips::          Conventions for writing comments.
  496. * Library Headers::           Standard headers for library packages.
  497. File: elisp,  Node: Style Tips,  Next: Compilation Tips,  Up: Tips
  498. Writing Clean Lisp Programs
  499. ===========================
  500.    Here are some tips for avoiding common errors in writing Lisp code
  501. intended for widespread use:
  502.    * Since all global variables share the same name space, and all
  503.      functions share another name space, you should choose a short word
  504.      to distinguish your program from other Lisp programs.  Then take
  505.      care to begin the names of all global variables, constants, and
  506.      functions with the chosen prefix.  This helps avoid name conflicts.
  507.      This recommendation applies even to names for traditional Lisp
  508.      primitives that are not primitives in Emacs Lisp--even to `cadr'.
  509.      Believe it or not, there is more than one plausible way to define
  510.      `cadr'.  Play it safe; append your name prefix to produce a name
  511.      like `foo-cadr' or `mylib-cadr' instead.
  512.      If one prefix is insufficient, your package may use two or three
  513.      alternative common prefixes, so long as they make sense.
  514.      Separate the prefix from the rest of the symbol name with a hyphen,
  515.      `-'.  This will be consistent with Emacs itself and with most Emacs
  516.      Lisp programs.
  517.    * It is often useful to put a call to `provide' in each separate
  518.      library program, at least if there is more than one entry point to
  519.      the program.
  520.    * If one file FOO uses a macro defined in another file BAR, FOO
  521.      should contain `(require 'BAR)' before the first use of the macro.
  522.      (And BAR should contain `(provide 'BAR)', to make the `require'
  523.      work.)  This will cause BAR to be loaded when you byte-compile
  524.      FOO.  Otherwise, you risk compiling FOO without the necessary
  525.      macro loaded, and that would produce compiled code that won't work
  526.      right.  *Note Compiling Macros::.
  527.    * If you define a major mode, make sure to run a hook variable using
  528.      `run-hooks', just as the existing major modes do.  *Note Hooks::.
  529.    * Please do not define `C-c LETTER' as a key in your major modes.
  530.      These sequences are reserved for users; they are the *only*
  531.      sequences reserved for users, so we cannot do without them.
  532.      Instead, define sequences consisting of `C-c' followed by a
  533.      non-letter.  These sequences are reserved for major modes.
  534.      Changing all the major modes in Emacs 18 so they would follow this
  535.      convention was a lot of work.  Abandoning this convention would
  536.      waste that work and inconvenience the users.
  537.    * It is a bad idea to define aliases for the Emacs primitives.  Use
  538.      the standard names instead.
  539.    * Redefining an Emacs primitive is an even worse idea.  It may do
  540.      the right thing for a particular program, but there is no telling
  541.      what other programs might break as a result.
  542.    * If a file does replace any of the functions or library programs of
  543.      standard Emacs, prominent comments at the beginning of the file
  544.      should say which functions are replaced, and how the behavior of
  545.      the replacements differs from that of the originals.
  546.    * If a file requires certain standard library programs to be loaded
  547.      beforehand, then the comments at the beginning of the file should
  548.      say so.
  549.    * Please keep the names of your Emacs Lisp source files to 13
  550.      characters or less.  This way, if the files are compiled, the
  551.      compiled files' names will be 14 characters or less, which is
  552.      short enough to fit on all kinds of Unix systems.
  553.    * Don't use `next-line' or `previous-line' in programs; nearly
  554.      always, `forward-line' is more convenient as well as more
  555.      predictable and robust.  *Note Text Lines::.
  556.    * Don't use functions that set the mark in your Lisp code (unless
  557.      you are writing a command to set the mark).  The mark is a
  558.      user-level feature, so it is incorrect to change the mark except
  559.      to supply a value for the user's benefit.  *Note The Mark::.
  560.      In particular, don't use these functions:
  561.         * `beginning-of-buffer', `end-of-buffer'
  562.         * `replace-string', `replace-regexp'
  563.      If you just want to move point, or replace a certain string,
  564.      without any of the other features intended for interactive users,
  565.      you can replace these functions with one or two lines of simple
  566.      Lisp code.
  567.    * The recommended way to print a message in the echo area is with
  568.      the `message' function, not `princ'.  *Note The Echo Area::.
  569.    * When you encounter an error condition, call the function `error'
  570.      (or `signal').  The function `error' does not return.  *Note
  571.      Signaling Errors::.
  572.      Do not use `message', `throw', `sleep-for', or `beep' to report
  573.      errors.
  574.    * Avoid using recursive edits.  Instead, do what the Rmail `w'
  575.      command does: use a new local keymap that contains one command
  576.      defined to switch back to the old local keymap.  Or do what the
  577.      `edit-options' command does: switch to another buffer and let the
  578.      user switch back at will.  *Note Recursive Editing::.
  579.    * In some other systems there is a convention of choosing variable
  580.      names that begin and end with `*'.  We don't use that convention
  581.      in Emacs Lisp, so please don't use it in your library.  (In fact,
  582.      in Emacs names of this form are conventionally used for
  583.      program-generated buffers.) The users will find Emacs more
  584.      coherent if all libraries use the same conventions.
  585.    * Indent each function with `C-M-q' (`indent-sexp') using the
  586.      default indentation parameters.
  587.    * Don't make a habit of putting close-parentheses on lines by
  588.      themselves; Lisp programmers find this disconcerting.  Once in a
  589.      while, when there is a sequence of many consecutive
  590.      close-parentheses, it may make sense to split them in one or two
  591.      significant places.
  592.    * Please put a copyright notice on the file if you give copies to
  593.      anyone.  Use the same lines that appear at the top of the Lisp
  594.      files in Emacs itself.  If you have not signed papers to assign
  595.      the copyright to the Foundation, then place your name in the
  596.      copyright notice in place of the Foundation's name.
  597. File: elisp,  Node: Compilation Tips,  Next: Documentation Tips,  Prev: Style Tips,  Up: Tips
  598. Tips for Making Compiled Code Fast
  599. ==================================
  600.    Here are ways of improving the execution speed of byte-compiled lisp
  601. programs.
  602.    * Use the `profile' library to profile your program.  See the file
  603.      `profile.el' for instructions.
  604.    * Use iteration rather than recursion whenever possible.  Function
  605.      calls are slow in Emacs Lisp even when a compiled function is
  606.      calling another compiled function.
  607.    * Using the primitive list-searching functions `memq', `assq' or
  608.      `assoc' is even faster than explicit iteration.  It may be worth
  609.      rearranging a data structure so that one of these primitive search
  610.      functions can be used.
  611.    * Certain built-in functions are handled specially by the byte
  612.      compiler avoiding the need for an ordinary function call.  It is a
  613.      good idea to use these functions rather than alternatives.  To see
  614.      whether a function is handled specially by the compiler, examine
  615.      its `byte-compile' property.  If the property is non-`nil', then
  616.      the function is handled specially.
  617.      For example, the following input will show you that `aref' is
  618.      compiled specially (*note Array Functions::.) while `elt' is not
  619.      (*note Sequence Functions::.):
  620.           (get 'aref 'byte-compile)
  621.                => byte-compile-two-args
  622.           (get 'elt 'byte-compile)
  623.                => nil
  624.    * Make small functions inline, so that calls to them in compiled
  625.      code run faster.  *Note Inline Functions::.
  626. File: elisp,  Node: Documentation Tips,  Next: Comment Tips,  Prev: Compilation Tips,  Up: Tips
  627. Tips for Documentation Strings
  628. ==============================
  629.    Here are some tips for the writing of documentation strings.
  630.    * Every command, function or variable intended for users to know
  631.      about should have a documentation string.
  632.    * An internal subroutine of a Lisp program need not have a
  633.      documentation string, and you can save space by using a comment
  634.      instead.
  635.    * The first line of the documentation string should consist of one
  636.      or two complete sentences which stand on their own as a summary.
  637.      In particular, start the line with a capital letter and end with a
  638.      period.
  639.      The documentation string can have additional lines which expand on
  640.      the details of how to use the function or variable.  The
  641.      additional lines should be made up of complete sentences also, but
  642.      they may be filled if that looks good.
  643.    * Do not start or end a documentation string with whitespace.
  644.    * Format the documentation string so that it fits in an Emacs window
  645.      on an 80 column screen.  It is a good idea for most lines to be no
  646.      wider than 60 characters.  The first line can be wider if
  647.      necessary to fit the information that ought to be there.
  648.      However, rather than simply filling the entire documentation
  649.      string, you can make it much more readable by choosing line breaks
  650.      with care.  Use blank lines between topics if the documentation
  651.      string is long.
  652.    * *Do not* indent subsequent lines of a documentation string so that
  653.      the text is lined up in the source code with the text of the first
  654.      line.  This looks nice in the source code, but looks bizarre when
  655.      users view the documentation.  Remember that the indentation
  656.      before the starting double-quote is not part of the string!
  657.    * A variable's documentation string should start with `*' if the
  658.      variable is one that users would want to set interactively often.
  659.      If the value is a long list, or a function, or if the variable
  660.      would only be set in init files, then don't start the
  661.      documentation string with `*'.  *Note Defining Variables::.
  662.    * The documentation string for a variable that is a yes-or-no flag
  663.      should start with words such as "Non-nil means...", to make it
  664.      clear both that the variable only has two meaningfully distinct
  665.      values and which value means "yes".
  666.    * When a function's documentation string mentions the value of an
  667.      argument of the function, use the argument name in capital letters
  668.      as if it were a name for that value.  Thus, the documentation
  669.      string of the function `/' refers to its second argument as
  670.      `DIVISOR'.
  671.      Also use all caps for meta-syntactic variables, such as when you
  672.      show the decomposition of a list or vector into subunits, some of
  673.      which may be variable.
  674.    * When a documentation string refers to a Lisp symbol, write it as it
  675.      would be printed (which usually means in lower case), with
  676.      single-quotes around it.  For example: ``lambda''.  There are two
  677.      exceptions: write `t' and `nil' without single-quotes.
  678.    * Don't write key sequences directly in documentation strings.
  679.      Instead, use the `\\[...]' construct to stand for them.  For
  680.      example, instead of writing `C-f', write `\\[forward-char]'.  When
  681.      the documentation string is printed, Emacs will substitute
  682.      whatever key is currently bound to `forward-char'.  This will
  683.      usually be `C-f', but if the user has moved key bindings, it will
  684.      be the correct key for that user.  *Note Keys in Documentation::.
  685.    * In documentation strings for a major mode, you will want to refer
  686.      to the key bindings of that mode's local map, rather than global
  687.      ones.  Therefore, use the construct `\\<...>' once in the
  688.      documentation string to specify which key map to use.  Do this
  689.      before the first use of `\\[...]'.  The text inside the `\\<...>'
  690.      should be the name of the variable containing the local keymap for
  691.      the major mode.
  692.      It is not practical to use `\\[...]' very many times, because
  693.      display of the documentation string will become slow.  So use this
  694.      to describe the most important commands in your major mode, and
  695.      then use `\\{...}' to display the rest of the mode's keymap.
  696.    * Don't use the term "Elisp", since that is or was a trademark.  Use
  697.      the term "Emacs Lisp".
  698. File: elisp,  Node: Comment Tips,  Next: Library Headers,  Prev: Documentation Tips,  Up: Tips
  699. Tips on Writing Comments
  700. ========================
  701.    We recommend these conventions for where to put comments and how to
  702. indent them:
  703.      Comments that start with a single semicolon, `;', should all be
  704.      aligned to the same column on the right of the source code.  Such
  705.      comments usually explain how the code on the same line does its
  706.      job.  In Lisp mode and related modes, the `M-;'
  707.      (`indent-for-comment') command automatically inserts such a `;' in
  708.      the right place, or aligns such a comment if it is already
  709.      inserted.
  710.      (The following examples are taken from the Emacs sources.)
  711.           (setq base-version-list                 ; there was a base
  712.                 (assoc (substring fn 0 start-vn)  ; version to which
  713.                        file-version-assoc-list))  ; this looks like
  714.                                                   ; a subversion
  715.      Comments that start with two semicolons, `;;', should be aligned to
  716.      the same level of indentation as the code.  Such comments are used
  717.      to describe the purpose of the following lines or the state of the
  718.      program at that point.  For example:
  719.           (prog1 (setq auto-fill-function
  720.                        ...
  721.                        ...
  722.             ;; update mode-line
  723.             (force-mode-line-update)))
  724.      These comments are also written before a function definition to
  725.      explain what the function does and how to call it properly.
  726. `;;;'
  727.      Comments that start with three semicolons, `;;;', should start at
  728.      the left margin.  Such comments are not used within function
  729.      definitions, but are used to make more general comments.  For
  730.      example:
  731.           ;;; This Lisp code is run in Emacs
  732.           ;;; when it is to operate asa server
  733.           ;;; for other processes.
  734. `;;;;'
  735.      Comments that start with four semicolons, `;;;;', should be aligned
  736.      to the left margin and are used for headings of major sections of a
  737.      program.  For example:
  738.           ;;;; The kill ring
  739. The indentation commands of the Lisp modes in Emacs, such as `M-;'
  740. (`indent-for-comment') and TAB (`lisp-indent-line') automatically
  741. indent comments according to these conventions, depending on the the
  742. number of semicolons.  *Note Manipulating Comments: (emacs)Comments.
  743.    If you wish to "comment out" a number of lines of code, use triple
  744. semicolons at the beginnings of the lines.
  745.    Any character may be included in a comment, but it is advisable to
  746. precede a character with syntactic significance in Lisp (such as `\' or
  747. unpaired `(' or `)') with a `\', to prevent it from confusing the Emacs
  748. commands for editing Lisp.
  749. File: elisp,  Node: Library Headers,  Prev: Comment Tips,  Up: Tips
  750. Conventional Headers for Emacs Libraries
  751. ========================================
  752.    Emacs 19 has conventions for using special comments in Lisp libraries
  753. to divide them into sections and give information such as who wrote
  754. them.  This section explains these conventions.  First, an example:
  755.      ;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers
  756.      
  757.      ;; Copyright (C) 1992 Free Software Foundation, Inc.
  758.      
  759.      ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
  760.      ;; Maintainer: Eric S. Raymond <esr@snark.thyrsus.com>
  761.      ;; Created: 14 Jul 1992
  762.      ;; Version: 1.2
  763.      ;; Keywords: docs
  764.      
  765.      ;; This file is part of GNU Emacs.
  766.      COPYING CONDITIONS...
  767.    The very first line should have this format:
  768.      ;;; FILENAME --- DESCRIPTION
  769. The description should be complete in one line.
  770.    After the copyright notice come several "header comment" lines, each
  771. beginning with `;;; HEADER-NAME:'.  Here is a table of the conventional
  772. possibilities for HEADER-NAME:
  773. `Author'
  774.      This line states the name and net address of at least the principal
  775.      author of the library.
  776.      If there are multiple authors, you can list them on continuation
  777.      lines led by `;;<TAB>', like this:
  778.           ;; Author: Ashwin Ram <Ram-Ashwin@cs.yale.edu>
  779.           ;;    Dave Sill <de5@ornl.gov>
  780.           ;;    Dave Brennan <brennan@hal.com>
  781.           ;;    Eric Raymond <esr@snark.thyrsus.com>
  782. `Maintainer'
  783.      This line should contain a single name/address as in the Author
  784.      line, or an address only, or the string "FSF".  If there is no
  785.      maintainer line, the person(s) in the Author field are presumed to
  786.      be the maintainers.  The example above is mildly bogus because the
  787.      maintainer line is redundant.
  788.      The idea behind the `Author' and `Maintainer' lines is to make
  789.      possible a Lisp function to "send mail to the maintainer" without
  790.      having to mine the name out by hand.
  791.      Be sure to surround the network address with `<...>' if you
  792.      include the person's full name as well as the network address.
  793. `Created'
  794.      This optional line gives the original creation date of the file.
  795.      For historical interest only.
  796. `Version'
  797.      If you wish to record version numbers for the individual Lisp
  798.      program, put them in this line.
  799. `Adapted-By'
  800.      In this header line, place the name of the person who adapted the
  801.      library for installation (to make it fit the style conventions, for
  802.      example.
  803. `Keywords'
  804.      This line lists keywords for the `finder-by-keyword' help command.
  805.      This field is important; it's how people will find your package
  806.      when they're looking for things by topic area.
  807.    Just about every Lisp library ought to have the `Author' and
  808. `Keywords' header comment lines.  Use the others if they are
  809. appropriate.  You can also put in header lines with other header
  810. names--they have no standard meanings, so they can't do any harm.
  811.    We use additional stylized comments to subdivide the contents of the
  812. library file.  Here is a table of them:
  813. `;;; Commentary:'
  814.      This begins introductory comments that explain how the library
  815.      works.  It should come right after the copying permissions.
  816. `;;; Change log:'
  817.      This begins change log information stored in the library file (if
  818.      you store the change history there).  For most of the Lisp files
  819.      distributed with Emacs, the change history is kept in the file
  820.      `ChangeLog' and not in the source file at all; these files do not
  821.      have a `;;; Change log:' line.
  822. `;;; Code:'
  823.      This begins the actual code of the program.
  824. `;;; FILENAME ends here'
  825.      This is the "footer line"; it appears at the very end of the file.
  826.      Its purpose is to enable people to detect truncated versions of
  827.      the file from the lack of a footer line.
  828. File: elisp,  Node: GNU Emacs Internals,  Next: Standard Errors,  Prev: Tips,  Up: Top
  829. GNU Emacs Internals
  830. *******************
  831.    This chapter describes how the runnable Emacs executable is dumped
  832. with the preloaded Lisp libraries in it, how storage is allocated, and
  833. some internal aspects of GNU Emacs that may be of interest to C
  834. programmers.
  835. * Menu:
  836. * Building Emacs::      How to preload Lisp libraries into Emacs.
  837. * Pure Storage::        A kludge to make preloaded Lisp functions sharable.
  838. * Garbage Collection::  Reclaiming space for Lisp objects no longer used.
  839. * Object Internals::    Data formats of buffers, windows, processes.
  840. * Writing Emacs Primitives::   Writing C code for Emacs.
  841. File: elisp,  Node: Building Emacs,  Next: Pure Storage,  Prev: GNU Emacs Internals,  Up: GNU Emacs Internals
  842. Building Emacs
  843. ==============
  844.    The first step in building Emacs is to compile the C sources.  This
  845. produces a program called `temacs', also called a "bare impure Emacs".
  846. It contains the Emacs Lisp interpreter and I/O routines, but not the
  847. editing commands.
  848.    Then, to create a working Emacs editor, issue the `temacs -l loadup'
  849. command.  This directs `temacs' to evaluate the Lisp files specified in
  850. the file `loadup.el'.  These files set up the normal Emacs editing
  851. environment, resulting in an Emacs which is still impure but no longer
  852. bare.
  853.    It takes a long time to load the standard Lisp files.  Luckily, you
  854. don't have to do this each time you run Emacs; `temacs' can dump out an
  855. executable program called `emacs' which has these files preloaded.
  856. `emacs' starts more quickly because it does not need to load the files.
  857. This is the program that is normally installed.
  858.    To create `emacs', use the command `temacs -batch -l loadup dump'.
  859. The purpose of `-batch' here is to prevent `temacs' from trying to
  860. initialize any of its data on the terminal; this ensures that the
  861. tables of terminal information are empty in the dumped Emacs.
  862.    When the `emacs' executable is started, it automatically loads the
  863. user's `.emacs' file, or the default initialization file `default.el'
  864. if the user has none.  (*Note Starting Up::.)  With the `.emacs' file,
  865. you can produce a version of Emacs that suits you and is not the same
  866. as the version other people use.  With `default.el', you can customize
  867. Emacs for all the users at your site who don't choose to customize it
  868. for themselves.  (For further reflection: why is this different from
  869. the case of the barber who shaves every man who doesn't shave himself?)
  870.    On some systems, dumping does not work.  Then, you must start Emacs
  871. with the `temacs -l loadup' command each time you use it.  This takes a
  872. long time, but since you need to start Emacs once a day at most--and
  873. once a week or less frequently if you never log out--the extra time is
  874. not too severe a problem.
  875.    Before `emacs' is dumped, the documentation strings for primitive
  876. and preloaded functions (and variables) need to be found in the file
  877. where they are stored.  This is done by calling `Snarf-documentation'
  878. (*note Accessing Documentation::.).  These strings were moved out of
  879. `emacs' to make it smaller.  *Note Documentation Basics::.
  880.  - Function: dump-emacs TO-FILE FROM-FILE
  881.      This function dumps the current state of Emacs into an executable
  882.      file TO-FILE.  It takes symbols from FROM-FILE (this is normally
  883.      the executable file `temacs').
  884.      If you use this function in an Emacs that was already dumped, you
  885.      must set `command-line-processed' to `nil' first for good results.
  886.      *Note Command Line Arguments::.
  887.  - Command: emacs-version
  888.      This function returns a string describing the version of Emacs
  889.      that is running.  It is useful to include this string in bug
  890.      reports.
  891.           (emacs-version)
  892.             => "GNU Emacs 18.36.1 of Fri Feb 27 1987 on slug
  893.                (berkeley-unix)"
  894.      Called interactively, the function prints the same information in
  895.      the echo area.
  896.  - Variable: emacs-build-time
  897.      The value of this variable is the time at which Emacs was built at
  898.      the local site.
  899.           emacs-build-time
  900.                => "Fri Feb 27 14:55:57 1987"
  901.  - Variable: emacs-version
  902.      The value of this variable is the version of Emacs being run.  It
  903.      is a string, e.g. `"18.36.1"'.
  904.